import 'package:flutter/material.dart';
import 'package:kq_flutter_tv_widgets/resources/kq_theme_colors.dart';
import 'package:kq_flutter_tv_widgets/widgets/chart/kq_chart_pie.dart';
import 'package:kq_flutter_tv_widgets/widgets/chart/kq_chart_pie_model.dart';

class KqChartPieDemo extends StatefulWidget {
  const KqChartPieDemo({super.key});

  @override
  State<KqChartPieDemo> createState() => _KqChartPieDemoState();
}

class _KqChartPieDemoState extends State<KqChartPieDemo> {
  List<ChartPieValue> pieList = [
    ChartPieValue(value: '100', color: KqThemeColors.bgBlue),
    ChartPieValue(value: '100', color: KqThemeColors.textRed),
    ChartPieValue(value: '100', color: KqThemeColors.textYellow),
  ];

  ChartPieModel model = ChartPieModel(
      sizeHeight: 300, sizeWitdh: 300, outRadius: 120, chartModel: []);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        children: [
          KqChartPie(
            chart: model,
            height: 300,
            width: 300,
            backGroundColor: KqThemeColors.bgF4,
            data: pieList,
            centerText: '扇形分布图',
            textStyle:
                const TextStyle(fontSize: 14, color: KqThemeColors.text333),
          ),
        ],
      ),
    );
  }
}
